import { request } from '@/service/request';

/** 获取规则管理列表 */
export function fetchGetRuleList (params?: Api.System.RuleSearchParams) {
    return request<Api.System.RuleList>({
        url: '/system/rule/list',
        method: 'get',
        params
    });
}

/** 新增规则管理 */
export function fetchCreateRule (data: Api.System.RuleOperateParams) {
    return request<boolean>({
        url: '/system/rule',
        method: 'post',
        data
    });
}

/** 修改规则管理 */
export function fetchUpdateRule (data: Api.System.RuleOperateParams) {
    return request<boolean>({
        url: '/system/rule',
        method: 'put',
        data
    });
}

/** 批量删除规则管理 */
export function fetchBatchDeleteRule (ids: CommonType.IdType[]) {
    return request<boolean>({
        url: `/system/rule/${ids.join(',')}`,
        method: 'delete'
    });
}
